(function () {
    'use strict';

    angular.module('app')
        .service('SysLogService',SysLogService);

   SysLogService.$inject = ['$http', '$q', 'APP_CONST'];
    function SysLogService(http, $q, APP_CONST) {

        this.list = function list(params) {
            var d = $q.defer();
			http.get(APP_CONST.PROPERTY.API_URL+  '/sys/log/list', {
		    	params: params
			})
            .success(function (data) {
                d.resolve(data);
            })
                .error(function () {
                    d.reject();
                });

            return d.promise;
        };

        this.getById = function getById(id) {
            var d = $q.defer();

            http.get(APP_CONST.PROPERTY.API_URL + '/sys/log/' + id)
            .success(function (data) {
                d.resolve(data);
            })
                .error(function () {
                    d.reject();
                });

            return d.promise;
        };

    }
})();